#ifndef CUSTOMLISTVIEW_H
#define CUSTOMLISTVIEW_H

#include <QListView>
#include <QStringListModel>
class CustomListView : public QListView
{
    Q_OBJECT

public:
    CustomListView(QWidget *parent = nullptr) : QListView(parent) {
        model = new QStringListModel(this);
        setModel(model);
    }

    void setData(const QStringList &data) {
        model->setStringList(data);
    }

public slots:
    void filterDataSlot(const QString &filterText) {
        QStringList filteredList = originalData.filter(filterText, Qt::CaseInsensitive);
        model->setStringList(filteredList);
    }

private:
    QStringListModel *model;
    QStringList originalData;
};

#endif // CUSTOMLISTVIEW_H
